package com.my.internetplus.service;

import com.my.internetplus.dao.CartDao;
import com.my.internetplus.model.Cart;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class CartService {

    @Resource
    private CartDao cartDao;
    public void insertCart(int userid,int goodid,int sum){
        cartDao.insertCart(userid,goodid,sum);
    }
    public List<Map<String,String>> selectCartInfoList(int userid){
         return   cartDao.selectCartInfoList(userid);
    }

    public void updateCart(int cartid,int sum){
        cartDao.updateCart(cartid,sum);
    }

    public void subCart(int cartid){
        cartDao.subCart(cartid);
    }
    public void addCart(int cartid){
        cartDao.addCart(cartid);
    }
    public List<Map<String,String>>selectCartListsById(List idlist){
       return cartDao.selectCartListsById(idlist);
    }
}
